public class Main {
    public static void main(String[] args) {

        FlyweightFactory factory = new FlyweightFactory();
        Flyweight flyweightTom = factory.getFlyweight("Jack");
        Flyweight flyweightJerry =factory.getFlyweight("Cici");

        System.out.println(flyweightTom.operation()+flyweightTom.hashCode());
        System.out.println(flyweightJerry.operation()+flyweightJerry.hashCode());

        flyweightTom = factory.getFlyweight("Jack");
        System.out.println(flyweightTom.operation()+flyweightTom.hashCode());
    }
}